package com.hyc.config;

import com.hyc.Serializer.Serializer;
import com.hyc.serviceCenter.loadbalance.impl.ConsistencyHashBalance;
import com.hyc.serviceRegister.NacosServiceRegister;
import lombok.*;

import java.net.InetSocketAddress;

/**
 * @author 冷环渊
 * 配置类 默认末班
 * @date 2025/6/18 16:29
 * * @description RpcConfigTemplate
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
@ToString
public class RpcConfigTemplate {
    //名称
    private final String name = "PingHaoRpc";
    //端口
    private Integer port = 9001;
    //主机名
    private String host = "localhost";
    //nacos地址
    private String nacosAddress = new InetSocketAddress("localhost", 8848).toString();
    //版本号
    private String version = "1.0.0";
    //注册中心 暂时只支持nacos 之后如果有时间会多拓展几个
    private String registry = new NacosServiceRegister(null).toString();
    //序列化器 之后回去支持 proto
    private String serializer = Serializer.getSerializerByCode(1).toString();
    //负载均衡
    private String loadBalance = new ConsistencyHashBalance().toString();
}
